#!/usr/bin/env node

const { intro, select, isCancel, cancel } = require("@clack/prompts");

async function main() {
  console.clear();
  intro("i18n导入导出工具");
  const type = await select({
    message: "请选择操作类型",
    initialValue: "import",
    options: [
      { value: "import", label: "导入翻译" },
      { value: "export", label: "导出翻译" },
      { value: "settings", label: "设置i18n默认配置" },
    ],
  });

  if (isCancel(type)) {
    cancel("操作取消");
    process.exit(0);
  }

  await require(`./commands/${type}`).main();
}

main();
